package com.ruoyi.web.controller.pc;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.HomeBanner;
import com.ruoyi.common.core.domain.entity.Section;
import com.ruoyi.common.core.page.CommonQuery;
import com.ruoyi.system.service.IHomeBannerService;
import com.ruoyi.system.service.ISectionService;
import com.ruoyi.system.service.ISysDicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author linxz
 * @since 2025-01-17 14:05
 */
@RestController
@RequestMapping("/pc")
public class IndexConfigController extends BaseController {

    @Autowired
    private ISectionService service;
    @Autowired
    private IHomeBannerService iHomeBannerService;
    @Autowired
    private ISysDicService iSysDicService;

    @PostMapping("/configList")
    public List<Section> configList(@RequestBody CommonQuery query) {
        List<Section> sectionList = service.selectList(query);
        return sectionList;

    }

    @PostMapping("/homeBanner")
    public List<HomeBanner> homeBanner(@RequestBody CommonQuery query) {
        List<HomeBanner> homeBanner = iHomeBannerService.listByPc(query);
        return homeBanner;

    }

    @PostMapping("/footerLinkUs")
    public List<HomeBanner> footerLinkUs(@RequestBody CommonQuery query) {
        List<HomeBanner> homeBanner = iHomeBannerService.listByPc(query);
        return homeBanner;

    }
}
